//
//  MoreButtonCellTableViewCell.m
//  PLRLiveShow
//
//  Created by 赵小燕 on 2017/8/20.
//  Copyright © 2017年 xiaoyanzhao. All rights reserved.
//

#import "MoreButtonCellTableViewCell.h"
#import "UIScreen+ScreenSize.h"
#import <Masonry.h>

@implementation MoreButtonCellTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        NSArray *array = [[NSArray alloc] initWithObjects:@"消息",@"设置", @"充值", nil];
        SEL selector1 = @selector(clickMessage);
        SEL selector2 = @selector(clickSetting);
        SEL selector3 = @selector(clickRecharge);
        NSArray *selArray = [[NSArray alloc] initWithObjects:NSStringFromSelector(selector1), NSStringFromSelector(selector2), NSStringFromSelector(selector3), nil];

        for (int i = 0; i < 3; i++) {
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = CGRectMake([UIScreen screenwidth] / 3 * i, 0, [UIScreen screenwidth] / 3, 0);
            [button setTitle:array[i] forState:UIControlStateNormal];
            [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
            button.titleLabel.font = [UIFont systemFontOfSize:14];
            [button addTarget:self action:NSSelectorFromString(selArray[i]) forControlEvents:UIControlEventTouchUpInside];
            [self.contentView addSubview:button];
            button.titleEdgeInsets = UIEdgeInsetsMake(40, 0, 10, 0);
//            button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        }
    }
    return self;
}

- (void)clickMessage {
    
}

- (void)clickSetting {
    
}

- (void)clickRecharge {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
